package com.atguigu.principle.singleresponsibility.liskov;

/**
 * @Author: yangtao
 * @Description:
 */
public class liskov {

    public static void main(String[] args) {
      A a = new A();
      System.out.println("11-3=" + a.func1(11,3));
      System.out.println("1-8=" + a.func1(1,8));
    }
}

//A类
 class A{
    //返回两个数的差
    public int func1(int num1, int num2){
        return num1 - num2;
    }
 }

 //B类集成A类 增加了一个新功能 完成两个数相加
//然后和9求和
 class B extends A{
    public int func1(int a, int b){
        return a + b;
    }
    public int func2(int a, int b){
        return func1(a,b) + 9;
    }
 }